dojo.provide("uws.drawing.activity.Activity");
dojo.require('uws.drawing.Component');

dojo.declare('uws.drawing.activity.Activity',uws.drawing.Component,{
	constructor: function(surface,id,dx,dy, sortOrder,label,fromDS){
		this.center_x = 60;
		this.center_y = 25;
		this.label = label;
		this.sortOrder = sortOrder;
		
		if(fromDS){
			dx+=this.center_x;
			dy+=this.center_y;
		}
		
		//connectors
		this.top_con=this.connectors_shape_group.createCircle({
			cx:60,
			cy:0,
			r:3
		}).setStroke("white").setFill("white");
		
		this.bottom_con=this.connectors_shape_group.createCircle({
			cx:60,
			cy:50,
			r:3
		}).setStroke("white").setFill("white");
		
		this.left_con=this.connectors_shape_group.createCircle({
			cx:0,
			cy:25,
			r:3
		}).setStroke("white").setFill("white");
		
		this.right_con=this.connectors_shape_group.createCircle({
			cx:120,
			cy:25,
			r:3
		}).setStroke("white").setFill("white");
		
		this.actual_shape_group.createRect({
			x:0,
			y:0,
			width:120,
			height:50,
			r:10
		}).setFill("white").setStroke("black");
		
		this.label_shape = this.group.createText({
			text: label,
			x: this.center_x,
			y: (this.center_y + 8),
			align:"middle"
		}).setFill("black").setFont(defaultFont);
		
		this._postCreate(dx, dy);
	},
	applyProperties:function(properties){
		this.label_shape.setShape({
			text: properties.label,
			x: this.center_x,
			y: (this.center_y + 8),
			align:"middle"
		}).setFill("black").setFont(defaultFont);
	}
});